import { Carousel } from 'antd-mobile'
function SwiperCom ({ bannerList }) {
    return (
        <Carousel
      autoplay={true}
      infinite
    >
      { bannerList && bannerList.map(item => (
        <a
          key={item.bannerid}
          href={ item.link }
          style={{ display: 'inline-block', width: '100%', height: '150px', overflow: 'hidden' }}
        >
          <img
            src={ item.img }
            alt={ item.alt }
            style={{ width: '100%', verticalAlign: 'top' }}
            onLoad={() => {
              // fire window resize event to change height
              window.dispatchEvent(new Event('resize'));
            }}
          />
        </a>
      ))}
    </Carousel>
    )
}

export default SwiperCom